//
//  VideoTableViewCell.swift
//  LearnDemo
//
//  Created by 振轩 on 2018/4/4.
//  Copyright © 2018年 振轩. All rights reserved.
//

import UIKit

class VideoTableViewCell: UITableViewCell {

    @IBOutlet weak var VideoImageView: UIImageView!
    
    
    @IBOutlet weak var titleLabel: UILabel!
    
    @IBOutlet weak var viewCountLabel: UILabel!
    
    var mode:videoSub?{
        
        didSet{
           
               VideoImageView.loadWebImage(withName: mode?.thumb, andIsOrgin: true)
            titleLabel.text = mode?.title
            viewCountLabel.text = "\(String(describing: mode!.viewNum))" + "次"
            
            
        }
        
        
    }
    @IBOutlet weak var editImageView: UIImageView!
    
    
    var isClick:Bool = false{
        didSet{
            
            
        }
    }
    
    
    var deleStatue:Bool = false{
        didSet{
            
            if deleStatue {
                
                editImageView.isHidden = false
                if (mode1?.isSelect)! {
                    
                    self.editImageView?.image = UIImage.init(named: "Select")
                    
                }else{
                    
                    self.editImageView?.image = UIImage.init(named: "UnSelect")
                    
                }
            }else{
                
                
                self.editImageView.isHidden = true
            }
        
            
            
        }
    }
    
    
    
    
    
    
    var mode1:ArticleMode?{
        didSet{
             VideoImageView.loadWebImage(withName: mode1?.thumb, andIsOrgin: true)
            viewCountLabel.text = "\(String(describing: mode1!.viewNum))"+"次"
            titleLabel.text=mode1?.title
            viewCountLabel.text = "\(String(describing: mode1!.collectNum))"+"次"
            
            if (mode1?.isSelect)! {
                
                self.editImageView?.image = UIImage.init(named: "Select")
                
            }else{
                
                self.editImageView?.image = UIImage.init(named: "UnSelect")
                
            }
        }
        
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
    
    
}
